<?php defined( '_JEXEC' ) or die( 'Restricted access' ); ?><?php defined( '_SEXEC' ) or die( 'Restricted access' ); ?>
<?php
	if(!isset($_SESSION['username']) && !isset($_SESSION['usertype']))
		header("location: index.php");
?>

<script language="javascript">

	$(function () { // this line makes sure this code runs on page load
		$('#button').click(function () {
			var from = $('#period_from').val();
			var to = $('#period_to').val();
			 
			if (from == '') {
				alert("Please select period from.");
				$('#period_from').focus();
			} else if (to == '') {
				alert("Please select period to.");
				$('#period_to').focus();
			} else {
				$("#myform").submit();
			}
			
			    
			    
		});
	});
	
	
</script>


<div id="title">Company Statement</div>

<form id="myform" method="post" action="daily_report_excel.php" target="_blank">
<table border="0" cellspacing="3" cellpadding="3" align="center">
	<tr>
		<td align=right>Period From:</td>
		<td><input name="period_from" id="period_from" type="text" value="<?php echo $period_from?>" onfocus="popcal(this)" /></td>
		<td align=right>Period To:</td>
		<td><input name="period_to" id="period_to" type="text" value="<?php echo $period_to?>" onfocus="popcal(this)" /></td>
	</tr>
	<tr>
		<td colspan="4" align="center">
			<input type="button" name="button" id="button" value="Download" class='button'/>
		</td>
	</tr>	
</table>
</form>
